package com.framework.common.message;

public enum MessageMode {
    NONE("-1","未知"),
    SINGLE("1", "私聊"),
    ROOM_CHAT("2", "直播室"),
    GROUP_CHAT("3", "群聊"),
    ;

    private String code;
    private String desc;

    MessageMode(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    @Override
    public String toString(){
        return super.toString().toLowerCase();
    }

    public static MessageMode valueOfName(String name) {
        for (MessageMode item : values()) {
            if (item.toString().equalsIgnoreCase(name)) {
                return item;
            }
        }
        return MessageMode.NONE;
    }
}
